home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 19 / Night Owl (The Best of Shareware)(NOPV 19)(1996).ISO / 018a / calv1295.zip / CCSCRIPT.ZIP / CALVARY.SLT < prev    next >
Text File  |  1994-09-04  |  10KB  |  344 lines

  1. // IMPORTANT: USE THE FOLLOWING GUIDES TO CHANGE THE DATA IN THIS
  2. // SCRIPT TO MEET YOUR INDIVIDUAL NEEDS.  USE THE MENTIONED
  3. // FIND AND REPLACE OPTIONS LISTED HERE.  IT IS VERY IMPORTANT
  4. // THAT YOU ALTER ALL THE MENTIONED FIND AND REPLACE OPTIONS
  5. // FOR THIS SCRIPT TO PROPERLY WORK ON YOUR SYSTEM.
  6.  
  7. // FIND "m630-7437" AND ADD A 619 AREA CODE IF NECESSARY.  keep the "m"!
  8. // FIND "D:\QWK\R" and REPLACE With your own REP "PATH" ONLY (no "\" at end!)
  9. // FIND "D:\QWK\Q" and REPLACE WITH your own QWK "PATH" ONLY (no "\" at end!)
  10. // FIND "D:\" REPLACE it with the DRIVE ONLY that your REP and QWK is in.
  11. // FIND "SHEPHERD.LOG" and REPLACE with whatever you like for Transfer Log
  12. // FIND "SHEPHERD.USE" and REPLACE it with whatever you want as a TELIX log.
  13. // FIND "FIRSTNAME LASTNAME PASSWORD" and replace with your information.
  14. //       Leave the spaces between FIRSTNAME LASTNAME PASSWORD
  15. //       Replace only the FIRSTNAME LASTNAME PASSWORD.  Leave the "'s.
  16.  
  17.  
  18. // REMEMBER.. TO EXECUTE THIS SCRIPT, YOU NEED TO DO THE FOLLOWING:
  19. // 1. RENAME THIS *.SLT FILE TO WHATEVER YOU LIKE.. LIKE SHEPHERD.SLT
  20. //    (ANY 8 characters preceeding the ".SLT"... keep .SLT ending.
  21. // 2. FIND AND REPLACE THE ABOVE MENTIONED PARAMETERS
  22. // 3. COMPILE THIS SCRIPT BY:
  23. //   a. make sure script is in the telix directory
  24. //   b. type "CS SCRIPTNAME" at the directory prompt
  25. // 4. You will have to run TELIX in the following manner:
  26. //           
  27. //        TELIX Sscriptname
  28. //  
  29. // EXAMPLE: TELIX Sshepherd    <---- Notice the "S" then whatever.
  30. //
  31. // that's it folks.. have fun!  John Scudder
  32. //                              The Shepherd's Flock Family BBS
  33. //                              619-630-7437 or 619-630-7303
  34. //
  35. // CHANGE NOTHING!!! BELOW THIS LINE.  CHANGE ONLY THE FIND/REPLACE ABOVE.
  36. // CHANGE NOTHING!!! BELOW THIS LINE.  CHANGE ONLY THE FIND/REPLACE ABOVE.
  37. // CHANGE NOTHING!!! BELOW THIS LINE.  CHANGE ONLY THE FIND/REPLACE ABOVE.
  38.  
  39.  
  40. //The Telix script follows below:
  41.  
  42. str user_name[] = "FIRSTNAME LASTNAME PASSWORD";
  43. str upfile[] = "D:\QWK\R\SHEPHERD.REP";  // upload path-filename
  44. str dnfile[] = "D:\QWK\Q\SHEPHERD.QWK";  // download path-filename
  45. str dialnum[] = "m630-7437";  // if manual dial delete below line
  46. int dialqty = 600;                      // dial attempts
  47. str doorname[] = "MAIL";           // SHEPHERD qwk hub door
  48. int proto = 'Z';                       //internal Telix zmodem
  49. str buf[50];
  50. str fspec[50] = "D:\QWK\R\SHEPHERD.REP";         //this name MUST BE UPPER CASE ONLY!
  51. //                                           for file search/compare
  52.  
  53. main()
  54.  
  55. {
  56.  
  57. dial_hub();
  58.  
  59. logon();
  60.  
  61.  _alarm_on = 0;
  62.  _sound_on = 0;
  63.  
  64.   timer_free(0);
  65.   track_free(0);
  66.  
  67.  //check for extant SHEPHERD.REP packet to determine if attempt upload
  68.  // delete old SHEPHERD.qwk in invoking batch file if previous run ok.
  69.  
  70.  if(filefind(fspec, 0, buf) != 0) goto up;
  71.  else goto down;
  72.  
  73.  up:
  74.  waitfor("Cam-Mail Command?",3000);
  75.  delay_scr(5);
  76.  cputs("U^M");
  77.  delay_scr(20);
  78.  send (proto,upfile);
  79.  if (waitfor("Upload Successful!",2000))
  80.    {
  81.     dos("IF EXIST D:\SHEP1.rep COPY D:\SHEP1.rep D:\SHEP2.REP",0);
  82.     dos("copy D:\QWK\R\SHEPHERD.REP D:\SHEP1.rep",0);
  83.     dos("del D:\QWK\R\SHEPHERD.REP", 0);
  84.     ustamp( "upload was successful."  , 1, 1 ) ;
  85.    }
  86. //you might need a "^M" here as safety for stuck menu, but unstable with
  87. //node 2 v.32 modem, so omitted.  TIMER loop better solution
  88.  
  89. down:
  90.   waitfor("Cam-Mail Command?",2000);
  91.   delay_scr(5);
  92.   cputs("D^M");
  93.   read_it();
  94.  
  95.  }
  96.  
  97. backup()
  98.     {
  99.       status_wind("making backup of SHEPHERD.QWK packet",10);
  100.       dos("if exist D:\SHEP2.QWK copy D:\SHEP2.QWK D:\SHEPHERD.3",0);
  101.       dos("if exist D:\QWK\Q\SHEPHERD.qwk copy D:\QWK\Q\SHEPHERD.QWK D:\SHEP1.QWK",0);
  102.       hangup();
  103.       cputs_tr("ATH1M0~^M");
  104.       ustamp( "SHEPHERD.QWK Backup successful."    , 1, 1 ) ;
  105.       exittelix();
  106.       return;
  107.     }
  108.  
  109. dial_hub()
  110. {
  111.         dial(dialnum, dialqty,1);
  112.         if (carrier())
  113.           {
  114.            return;
  115.           }
  116.         else
  117.           {
  118.             status_wind("Unable to connect",25);
  119.             hangup();
  120.             cputs_tr("ATH1M0~^M");
  121.             ustamp( "Unable to connect.",1,1);
  122.             exittelix();
  123.           }
  124. }
  125.  
  126.  
  127. logon()
  128.  
  129. {
  130.  
  131. // make backup copy of mail upload packet, "SHEPHERD.REP" just in case
  132.  
  133. dos("if exist D:\QWK\R\SHEPHERD.REP copy D:\QWK\R\SHEPHERD.REP D:\SHEPHERD.REP",0);
  134.  
  135.  int stat,t1,t2,t3,t4,tmark;
  136.  
  137. //turn off sounds so I can sleep
  138.  _alarm_on = 0;
  139.  _sound_on = 0;
  140.  
  141. // trim or disable these logs periodically, they (particulary cnet.log)
  142. // grow fast!  This way you can check phone bills against .use and
  143. // errors with cnet.log files.
  144.  
  145.  capture("SHEPHERD.LOG");
  146.  usagelog("SHEPHERD.USE");
  147.  
  148.  t1 = track("Enter Language # to use (Enter)=English?",5);
  149.  t2 = track("Do you want to see Color Screens? (ENTER = NO)?",5);
  150.  t3 = track("What is your Real First Name?",2);
  151.  t4 = track("Main Board Command?",2);
  152.  
  153.  tmark = timer_start(9000);
  154.  while (!time_up(tmark))
  155.   {
  156.     terminal();
  157. //  cputs("^M");
  158.     stat = track_hit(0);
  159.  
  160. // Read the "English" prompt...
  161.    if (stat == t1)
  162.     {
  163.      delay_scr(5);
  164.      cputs("1^M");
  165.     }
  166.  
  167. // Read the "Graphics" prompt...
  168.    if (stat == t2)
  169.     {
  170.      delay_scr(5);
  171.      cputs("N Q NS^M");
  172.     }
  173. // Read the "First Name" prompt...
  174.    else if (stat == t3)
  175.     {
  176.      delay_scr(5);
  177.      cputs(user_name);
  178.      cputs("^M");
  179.      delay_scr(5);
  180.      cputs("^M");
  181.      cputs("^M");
  182.     }
  183. // at main board prompt
  184.    else if (stat == t4)
  185.     {
  186.      break;
  187.     }
  188.   }
  189.  if (time_up(1))
  190.   {
  191.    ustamp("Logon and initial entry sequence failed.",1,1);
  192.    prints("Logon and initial entry sequence failed.");
  193.       {
  194.        hangup();
  195.        cputs ("ATH1M0^M");
  196.        exittelix(0,1);
  197.       }
  198.    return;
  199.   }
  200.  
  201.  timer_free(tmark);
  202.  track_free(0);
  203.  
  204.   delay_scr(5);
  205.   cputs("^M");
  206.   delay_scr(5);
  207.   cputs(doorname);
  208.   cputs("^M");
  209.   return;
  210. }
  211.  
  212. //end of logon, next sub is download receive
  213.  
  214.  
  215.  
  216.  
  217. read_it()
  218.  {
  219.    int tmark, t1, t2, t3, stat;
  220.    t1 = track("Do you want to receive these messages (Enter)=Yes?",5);
  221.    t2 = track("Warning, download was aborted!",0);
  222.    t3 = track("Sorry, no new messages were found",0);
  223.    int proto = 'Z';
  224.    str upfile[] = "D:\QWK\R\SHEPHERD.REP";  // upload path-filename
  225.    str dnfile[] = "D:\QWK\Q\SHEPHERD.QWK";  // download path-filename
  226.    str buf[50];
  227.    str fspec[50] = "D:\QWK\R\SHEPHERD.REP";          //name MUST BE UPPER CASE ONLY!
  228.  
  229.  tmark = timer_start(6000);
  230.  while (!time_up(tmark))
  231.     {
  232.          terminal();
  233.          if (!carrier())
  234.               {
  235.                  hangup();
  236.                  cputs_tr("ATH1M0~^M");
  237.                  ustamp( "Carrier dropped."  , 1, 1 ) ;
  238.                  prints("carrier dropped");
  239.                  delay(20);
  240.                  exittelix(0,1);
  241.                }
  242.         stat = track_hit(0);
  243.         if (stat == t1)
  244.           {
  245.                 delay_scr(10);
  246.                 cputs("Y^M");
  247.                 delay_scr(8);
  248.                 receive (proto,dnfile);
  249.                 //use the salt "run" statement to invoke external dsz
  250.                 if (waitfor("Download Successful!",20))
  251.                    {
  252.                       ustamp( "download was successful."  , 1, 1 ) ;
  253.                       delay_scr(5);
  254.                    }
  255.                 if (waitfor("Cam-Mail Command?",20))
  256.                    {
  257.                       delay_scr(2);
  258.                       cputs("^M");
  259.                       cputs("G^M");
  260.                       delay_scr(3);
  261.                    }
  262.  
  263. //              if (waitfor("(H)angup now or (Ctrl-K) to cancel",2000))
  264. //                   {
  265. //                      delay(15);
  266. //                      delay_scr(10);
  267. //                      cputs("H^M");
  268. //                      delay(20);
  269. //                      delay_scr(10);
  270. //                   }
  271.                 backup();
  272.                 hangup();
  273.                 cputs_tr ("ATH1M0^M");
  274.                 ustamp( "Download attempted."  , 1, 1 ) ;
  275.                 timer_free(tmark);
  276.                 track_free(0);
  277.                 exittelix(0, 1);
  278.              }
  279.     if (stat == t2)
  280.           {
  281.                 delay_scr(9);
  282.                 if (waitfor("Cam-Mail Command?",2000))
  283.                    {
  284.                       delay_scr(10);
  285.                       cputs("^M");
  286.                       cputs("^M");
  287.                       delay_scr(8);
  288.                     }
  289.                 cputs("D^M");
  290.                 if (waitfor("these messages (Enter)=Yes?",2000))
  291.                     {
  292.                       cputs("Y^M");
  293.                       delay_scr(8);
  294.                       receive (proto,dnfile);
  295.                       if (waitfor("Download Successful!",2000))
  296.                          {
  297.                             ustamp( "download was successful."  , 1, 1 ) ;
  298.                             delay_scr(5);
  299.                           }
  300.                       if (waitfor("(H)angup now or (Ctrl-K) to cancel",2000))
  301.                           {
  302.                             delay(15);
  303.                             delay_scr(10);
  304.                             cputs("H^M");
  305.                             delay(20);
  306.                             delay_scr(10);
  307.                             delay_scr(10);
  308.                            }
  309.                        }
  310.                   backup();
  311.                   hangup();
  312.                   cputs_tr ("ATH1M0^M");
  313.                   ustamp( "Download attempted."  , 1, 1 ) ;
  314.                  timer_free(tmark);
  315.                  track_free(0);
  316.                  exittelix(0, 1);
  317.              }
  318.  
  319.     if (stat == t3)
  320.           {
  321.             status_wind("track 2 ****",10);
  322.               timer_free(tmark);
  323.               track_free(0);
  324.               delay_scr(55); // delay in case SHEPHERD network delay
  325.               cputs("G^M");
  326.               delay(5);
  327.               hangup();
  328.               cputs_tr("ATH1M0~^M");
  329.               ustamp("No new messages" , 1, 1 );
  330.               exittelix();
  331.            }
  332.  
  333.    if (time_up(tmark))
  334.      {
  335.         hangup();
  336.         cputs_tr ("ATH1M0^M");
  337.         prints("timed out");
  338.         delay(20);
  339.         ustamp("timed out dl" ,1 ,1 );
  340.         exittelix(0,1);
  341.      }
  342.    }
  343.  }
  344.